/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2010.

	This file is part of Maxsi Engine.

	Maxsi Engine is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi engine is distributed in the hope that it will be useful, but WITHOUT
	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
	for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Engine. If not, see <http://www.gnu.org/licenses/>.

	MaxsiEngine.dll
	A general purpose C++ library for the Maxsi Technology Project.

	MaxsiWindowControls.h
	An object oriented interface to the glorious inner workings of the Maxsi
	Window System, which allows you to more easily deal with UI elements.

******************************************************************************/

#ifndef MaxsiWindowControls_H
#define MaxsiWindowControls_H

BeginMaxsiNamespace

CLASSLINK MaxsiWindowControl
{
public:
	MAXSI_DECLARE_CLASS(MaxsiWindowControl);

public:
	MaxsiWindowControl();

public:
	MaxsiWindowControl(MaxsiWindow* NewParent, MaxsiWindowSystem* NewWindowSystem, MaxsiControlSystem* ControlSystem);
	virtual ~MaxsiWindowControl();

public:
	MaxsiWindowSystem*		WindowSystem;
	MaxsiControlSystem*		ControlSystem;
	MaxsiHandle				Window;
	int						WindowLeft;
	int						WindowTop;
	int						WindowWidth;
	int						WindowHeight;
	MaxsiWindow*			Parent;
	MESTR*					Text;
	MaxsiHandle				TextFont;

public:
	virtual MaxsiError Initialize();
	virtual MaxsiError Destroy();
	virtual MaxsiError Show();
	virtual MaxsiError Hide();
	virtual MESTR* GetControlType();
	virtual int Left();
	virtual int Top();
	virtual int Width();
	virtual int Height();
	virtual int Right();
	virtual int Bottom();
	virtual MaxsiError Move(int NewLeft, int NewTop, int NewWidth, int NewHeight);
	virtual MaxsiError SetText(MESTR* NewText);
	virtual MaxsiError SetFont(MaxsiHandle NewFont);
	virtual MESTR* GetText();

};

CLASSLINK MaxsiWindowButton : public MaxsiWindowControl
{
public:	
	MAXSI_DECLARE_CHILD_CLASS(MaxsiWindowButton, MaxsiWindowControl);

public:
	MaxsiWindowButton();

public:
	MaxsiWindowButton(MaxsiWindow* NewParent, MaxsiWindowSystem* NewWindowSystem, MaxsiControlSystem* ControlSystem);
	virtual ~MaxsiWindowButton();

public:
	virtual MESTR* GetControlType();
	virtual MaxsiError SetText(MESTR* NewText);
	virtual MaxsiError SetFont(MaxsiHandle NewFont);

};

CLASSLINK MaxsiWindowLabel : public MaxsiWindowControl
{
public:	
	MAXSI_DECLARE_CHILD_CLASS(MaxsiWindowLabel, MaxsiWindowControl);

public:
	MaxsiWindowLabel();

public:
	MaxsiWindowLabel(MaxsiWindow* NewParent, MaxsiWindowSystem* NewWindowSystem, MaxsiControlSystem* ControlSystem);
	virtual ~MaxsiWindowLabel();

public:
	virtual MESTR* GetControlType();
	virtual MaxsiError SetText(MESTR* NewText);
	virtual MaxsiError SetFont(MaxsiHandle NewFont);

};

CLASSLINK MaxsiWindowTextSingleLine : public MaxsiWindowControl
{
public:	
	MAXSI_DECLARE_CHILD_CLASS(MaxsiWindowTextSingleLine, MaxsiWindowControl);

public:
	MaxsiWindowTextSingleLine();

public:
	MaxsiWindowTextSingleLine(MaxsiWindow* NewParent, MaxsiWindowSystem* NewWindowSystem, MaxsiControlSystem* ControlSystem);
	virtual ~MaxsiWindowTextSingleLine();

public:
	virtual MESTR* GetControlType();
	virtual MaxsiError SetText(MESTR* NewText);
	virtual MaxsiError SetFont(MaxsiHandle NewFont);
	virtual MESTR* GetText();

};

#define MAXSI_PROGRESS_CURRENT 0
#define MAXSI_PROGRESS_NORMAL 1
#define MAXSI_PROGRESS_INDETERMINATE 2
#define MAXSI_PROGRESS_PAUSED 3
#define MAXSI_PROGRESS_ERROR 4

CLASSLINK MaxsiWindowProgressBar : public MaxsiWindowControl
{
public:	
	MAXSI_DECLARE_CHILD_CLASS(MaxsiWindowProgressBar, MaxsiWindowControl);

public:
	MaxsiWindowProgressBar();

public:
	MaxsiWindowProgressBar(MaxsiWindow* NewParent, MaxsiWindowSystem* NewWindowSystem, MaxsiControlSystem* ControlSystem);
	virtual ~MaxsiWindowProgressBar();

public:
	float CurrentProgress;
	size_t CurrentType;

public:
	virtual MESTR* GetControlType();
	virtual MaxsiError SetProgress(float Progress, size_t Type = MAXSI_PROGRESS_CURRENT);

};

EndMaxsiNamespace

#endif